function validateRegex(input, regexp)
{
    var pattern = new RegExp(regexp);
    if (!pattern.test(input.value))
    {
        input.setCustomValidity('The two email addresses must match.');
    }
    else
        {
            input.setCustomValidity('The two email addresses must match.');
        }
}